package com.pan.alg.structure;

import java.util.Iterator;
import java.util.PriorityQueue;

public class PriorityQueueDemo {

  public static void defaultComparator() {
      /**
       * 默认是个最小堆
       */
    PriorityQueue<Integer> priorityQueue = new PriorityQueue();
    for (int i = 10; i > 0; i--) {
      //
      priorityQueue.add(i);
    }

    Iterator<Integer> iterator = priorityQueue.iterator();
    while (iterator.hasNext()) {
      System.out.println(iterator.next());
    }
}
        public static void main(String[] args) {

  }
}
